/*
 * File:   Rotor.h
 * Author: Elevator
 *
 * Created on July 14, 2013, 7:29 PM
 */

#ifndef DATA_ROTOR_H
#define DATA_ROTOR_H

#include <string>
#include "Common/Common.h"

#include "RotorDef.h"
#include "Rule.h"

namespace data {

	class Rotor {
	public:
		Rotor(
			std::string id,
			std::string detailAId,
			std::string detailBId,
			const Vec2 position,
			std::string definitionFileName ) :
		_id( id ),
		_detailAId( detailAId ),
		_detailBId( detailBId ),
		_position( position ),
		_definitionFileName( definitionFileName )
		{
			_rules = new Vector<Rule>();
		}

		~Rotor()
		{
			delete _rules;
		}

		inline const std::string GetId( ) const { return _id; }
		inline void SetId( std::string id ) { _id = id; }

		inline const std::string GetDetailAId( ) const { return _detailAId; }
		inline void SetDetailAId( std::string detailAId ) { _detailAId = detailAId; }

		inline const std::string GetDetailBId( ) const { return _detailBId; }
		inline void SetDetailDId( std::string detailBId ) { _detailBId = detailBId; }

		inline const Vec2 GetPosition( ) const { return _position; }
		inline void SetPosition( const Vec2& position){ _position = position; }

		const std::string GetDefinitionFileName( ) const { return _definitionFileName; }
		inline void SetDefinitionFileName( std::string definitionFileName ) { _definitionFileName = definitionFileName; }

		inline void AddRule( Rule rule ) { _rules->Add(rule); }
		inline void RemoveRule( Rule rule ) { _rules->Remove(rule); }
		inline const IIterable<Rule>* GetRules( ) const { return _rules; }

	private:
		std::string _id;
		std::string _detailAId;
		std::string _detailBId;
		Vec2 _position;
		std::string _definitionFileName;
		Vector<Rule>* _rules;
	};
}
#endif	/* ROTOR_H */

